const Router = require("koa-router")
const router = new Router({prefix:"/bl-article"})
const {queryArticles,queryArticleById,addControl,modifyControl,deleteByControl,deleteByIdsControl,queryByUserId,clawControl,commentByIdControl,addNewsControl} = require("../controller/articleController")
const {verifyToken} = require("../middlewares/auth.middle")
const {uploadOss} = require("../middlewares/upload.middle")
const {verifyQueryAllParams} = require("../middlewares/article.middle")

// 分页接口查询
router.post("/queryByuserId",queryByUserId);
router.post("/queryAll",verifyQueryAllParams,queryArticles);
router.post("/add",uploadOss,addControl);
router.get("/getArticleInfo",queryArticleById); 
router.post("/modify",verifyToken,uploadOss,modifyControl)
router.delete("/delete",verifyToken,deleteByControl);
router.post("/deleteIds",verifyToken,deleteByIdsControl)
router.post("/claw",clawControl);
router.get("/commentNews",commentByIdControl)
router.post("/addNews",addNewsControl);
module.exports = router;    